var express = require('express');
var runsql = require('../utils/runsql.js');
//建立一个路由容器
var router =  express.Router();

var sql = 'select * from p_users';
//首页
router.get('/',(req,res)=>{
   
    runsql(sql,(err,result)=>{
        if(err){
            console.log('执行失败',err);
            return;
        }
        res.render('index.html',{
            items: result
        });
    })

})

//导出
module.exports = router